Skip to content

Conversation

@Lagrang3
Copy link
Collaborator

@Lagrang3 Lagrang3 commented Oct 15, 2025

Several changes to askrene, mainly to introduce penalties (biases) on nodes and channels that
can be used across payments.
It addresses issue #8600.

  • add timestamps to channel biases,
    - [ ] add expiration on biases,
    - [ ] add expiration on knowledge data,
  • add node biases,
    - [x] penalize nodes on xpay that have failing channels,
  • tests,
  • fix docs,

@Lagrang3 Lagrang3 force-pushed the xpay-bad-nodes branch 8 times, most recently from 7f51753 to 9585fe2 Compare October 23, 2025 16:10
@Lagrang3 Lagrang3 marked this pull request as ready for review October 23, 2025 16:11
@Lagrang3 Lagrang3 requested a review from cdecker as a code owner October 23, 2025 16:11
@Lagrang3 Lagrang3 added this to the v25.12 milestone Oct 23, 2025
@Lagrang3 Lagrang3 changed the title [WIP] Xpay bad nodes Xpay bad nodes Oct 23, 2025
Copy link
Contributor

@rustyrussell rustyrussell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor API changes, and I need to be convinced of the xpay change.

@Lagrang3
Copy link
Collaborator Author

@rustyrussell: regarding the direction of the channels, either "in" or "out", it is true that it gives us more control but I can't think of a practical use case for making that distinction. If a node's out channels are heavily penalized that means we will eventually not going to route through it's in-channels anyways.

@cdecker
Copy link
Member

cdecker commented Nov 10, 2025

I don't quite see a case where we'd ever set out_direction = false or direction = in. Ultimately we want to bias a node that is failing our payments when forwarding, not payments leading into a given node.

This is similar to the Boltz situation, since they keep their channels purposefully unbalanced, with most capacity on their peer's side. We temporarily fixed that by blocklisting all outgoing channels: this way we'd never end up at that node, unless it is the destination, because incoming edges are still available. And I think it can be generalized this way.

I'd vote for removing the direction param, and just always using out as the interpretation. If we ever find a reason to penalize payments into a node, then we can still re-add the direction param.

We add one more field to biases: "timestamp".
With the timestamp variable old biases can be removed with the
askrene-age command.

Changelog-Added: Plugins: askrene channel biases now have an associated timestamp, and are timed out by askrene-age

Signed-off-by: Lagrang3 <lagrang3@protonmail.com>
Changelog-Added: askrene-bias-node: an RPC command to set a bias on node's outgoing or incoming channels.

Signed-off-by: Lagrang3 <lagrang3@protonmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants